@extends('back_end.layouts.default_info')

{{-- Web site Title --}}
@section('title')
订单信息
@stop
@section('content_header')
订单信息
@stop
{{-- breadcrumb --}}
@section('breadcrumb')
<li><a href="#"><i class="fa fa-dashboard"></i> {{{ Lang::get('general.back_end.home') }}}</a></li>
<li class="active">订单信息</li>
@stop

{{-- Content --}}
@section('content')
<div class="box box-primary">

    <div class="box-body">
      <!-- Tabs -->
      <ul class="nav nav-tabs">
        <li class="active"><a href="#tab-general" data-toggle="tab">订单信息</a></li>
      </ul>
      <!-- ./ tabs -->


      <!-- Tabs Content -->
      <div class="tab-content">
        <!-- General tab -->
        <div class="tab-pane active" id="tab-general">
          <br/>
            <dl class="dl-horizontal">
                <dt>订单号</dt><dd>{{ $order->id }}</dd>
                <dt>创建时间</dt><dd>{{ $order->created_at }}</dd>
                <dt>状态</dt><dd>{{ Order::$statuses[$order->status]['display_name'] }}</dd>
                <dt>总价</dt><dd><span class="fa fa-cny" style="font-size:12px;"></span>&nbsp;&nbsp;{{ $order->total_price }} 元</dd>

                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th class="col-xs-2">{{ Food::$column['name'] }}</th>
                            <th class="col-xs-2">{{ Food::$column['original_price'] }}</th>
                            <th class="col-xs-2">{{ Food::$column['price'] }}</th>
                            <th class="col-xs-1">{{ Food::$column['count'] }}</th>
                            <th class="col-xs-2">{{ Food::$column['created_at'] }}</th>
                            <th class="col-xs-2">{{{ Lang::get('table.actions') }}}</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach ($order->orderFoods as $entry)
                        <tr>
                            <th class="col-xs-2">{{ $entry->name }}</th>
                            <th class="col-xs-2">{{ $entry->original_price }}</th>
                            <th class="col-xs-2">{{ $entry->price }}</th>
                            <th class="col-xs-1">{{ $entry->count }}</th>
                            <th class="col-xs-2">{{ $entry->created_at }}</th>
                            <th class="col-xs-2">
                                @if (Auth::user()->can('update_food'))
                                <a href="{{{ URL::action('BackFoodController@doUpdate', $entry->id) }}}" class="iframe btn btn-xs btn-default"><i class="fa fa-edit"></i> {{{ Lang::get('button.edit') }}}</a>
                                @elseif (Auth::user()->can('show_food'))
                                <a href="{{{ URL::action('BackFoodController@doUpdate', $entry->id) }}}" class="iframe btn btn-xs btn-default"><i class="fa fa-eye"></i> {{{ Lang::get('button.view') }}}</a>
                                @endif
                            </th>
                        </tr>
                        @endforeach
                        </tbody>
                    </table>
            </dl>
        </div>
        <!-- ./ general tab -->

      </div>
      <!-- ./ tabs content -->

</div>
@stop
